package com.mtf.mq.consumer;

import com.mtf.common.enums.RocketMqEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.MixAll;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Author matengfei
 * @Date 2024/3/13 20:48
 * @PackageName:com.mtf.mq.consumer
 * @ClassName: TestRocketMqConsumer
 * @Description: 测试消费者
 * @Version 1.0
 */
@Slf4j
@Component
@RocketMQMessageListener(consumerGroup = "test_consumer_group",topic = "test_topic",consumeThreadMax = 1)
public class TestRocketMqConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("消费者组：springboot_consumer_group开始消费消息...");
        System.out.println(message);
        log.info("消费结束...");
    }
}
